import Vue from 'vue'
import moment from 'moment'

export default {
  // 获取列表
  async list (data) {
    return Vue.http.post('./gxActivityYearPlan/findYearPlanPage', data)
  },

  // 创建
  async create (data) {
    let params = Object.assign({}, data)
    params.act_sdate = moment(params.act_sdate).format('YYYY-MM-DD HH:mm:ss')
    params.act_edate = moment(params.act_edate).format('YYYY-MM-DD HH:mm:ss')
    return Vue.http.post('./gxActivityYearPlan/saveYearPlan', params)
  },

  // 更新
  async update (data) {
    let params = Object.assign({}, data)
    params.act_sdate = moment(params.act_sdate).format('YYYY-MM-DD HH:mm:ss')
    params.act_edate = moment(params.act_edate).format('YYYY-MM-DD HH:mm:ss')
    params.id = params.pk_act_year_plan
    return Vue.http.post('./gxActivityYearPlan/editYearPlan', params)
  },

  // 详情
  async detail (data) {
    return Vue.http.post('./gxActivityYearPlan/detailYearPlan', data)
  },

  // 删除
  async remove (data) {
    return Vue.http.post('./gxActivityYearPlan/delYearPlanInfo', data)
  }
}
